function TX = computeTerms(X, polynomial)

TX = zeros(size(X, 1), size(polynomial, 1));
for i = 1:size(polynomial, 1)
    TX(:, i) = prod(X(:, polynomial(i, :)), 2);
end
